<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div class="header_moible">
			顶岗实习管理系统(学生版)
		</div>
  <ul class="forminfo forminfo_mobile" style="margin-top: 20px;">
     <li><label>过程及内容:</label><textarea class="textinput textinput_mobile" name="practiceContent" id="practiceContent">${empty practiceComment ? "" : practiceComment.practiceContent }</textarea></li>
     <li><label>个人总结:</label><textarea class="textinput textinput_mobile" name="practiceSummary" id="practiceSummary">${empty practiceComment ? "" : practiceComment.practiceSummary }</textarea></li>
     <li><label>自我评价:</label><textarea class="textinput textinput_mobile" name="selfComment" id="selfComment">${empty practiceComment ? "" : practiceComment.selfComment }</textarea></li>
     <input type="hidden" name="studentNumber"  value="${practiceComment.studentNumber }"  >
	<li><label>&nbsp;</label><input name="" style="margin-top: 30px;" type="button" class="btn"  onclick="submitForm();"  value="确认保存"/></li>
    <li><label>&nbsp;</label><input type="button" name="button1" id="button1" class="btn"   value="返回" onclick="history.go(-1)"></li>
    </ul>
    </div>
</body>
	<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="layer/layer.js" ></script>
	<script type="text/javascript" src="js/jquery.tips.js"></script>
		<script type="text/javascript">
		function submitForm() {
			if ($("textarea[name='practiceContent']").val() == "") {
				showTips($("textarea[name='practiceContent']"), '请填写过程及内容!');
				return false;
			}
			if ($("textarea[name='practiceSummary']").val() == "") {
				showTips($("textarea[name='practiceSummary']"), '请填写个人总结!');
				return false;
			}
			if ($("textarea[name='selfComment']").val() == "") {
				showTips($("textarea[name='selfComment']"), '请填写自我评价!');
				return false;
			}
			$.ajax({
				type: "POST",
								url : "jobStudent/add_practicecomment.do",
								data : {
									studentNumber : $("input[name='studentNumber']").val(),
									practiceContent : $("textarea[name='practiceContent']").val(),
									practiceSummary : $("textarea[name='practiceSummary']").val(),
									selfComment : $("textarea[name='selfComment']").val(),
									
									},
								async: true,   
								dataType:'json',
								success : function(data) {
									if ("success" == data.result) {
										layer.alert('保存成功!', {
											skin : 'layer-ext-moon'
										}, function() {
											layer.closeAll(); 
										});
									} else {
										layer.alert('保存失败!', {
											skin : 'layer-ext-moon'
										});
									}
								}
							})
			}
		function showTips(obj,tips) {
			obj.tips({
				side:3,
		        msg:tips,
		        bg:'#e69138',
		        time:2
		    });
		}
		</script>
</html>